//app.js
App({
  onLaunch: function () {
    this.getCollectionGoodsCount()
  },

  //获取收藏商品的数量
  getCollectionGoodsCount(){
    const result = wx.getStorageSync('collection_goods') || [];
    const count = result.length
    this.globalData.collectionCount = count
  },

  //全局数据
  globalData: {
    collectionCount:0
  }
})